<template>
  <el-container class="main">
    <!---header-->
    <el-header>
      <!-- 查询条件-->
      <div class="filter-container">
        <el-col :span="3">
          <el-date-picker
            v-model="listQuery.Dt"
            type="date"
            placeholder="请选择日期"
            style="width: 100%"
            format="yyyy-MM-dd"
          />
        </el-col>

        <el-input
          v-model="listQuery.bllNo"
          placeholder="请输入单据号"
          style="width: 300px"
          class="filter-item"
          @keyup.enter.native="handleFilter"
        />
        <el-select
          v-if="this.logincpnid == 'system'"
          v-model="form.cpnID"
          filterable
          clearable
          class="filter-item"
          placeholder="请选择企业"
          :filter-method="cpnmatch"
          @clear="cpnmatch"
        >
          <el-option
            v-for="item in cpnoptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
            <span v-html="item.label" />
          </el-option>
        </el-select>
        <el-select
          v-model="listQuery.trialStt"
          class="filter-item"
          placeholder="请选择审核状态"
          clearable
        >
          <el-option
            v-for="item in trialSttoptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
            <span v-html="item.label" />
          </el-option>
        </el-select>
        <el-button
          class="filter-item seachbttn"
          type="primary"
          icon="el-icon-search"
          @click="handleFilter"
          >查询</el-button
        >
        <el-button
          class="filter-item seachbttn"
          type="primary"
          @click="handleFilterref"
        >
          清空
        </el-button>
      </div>
      <div
        class="filter_fenge"
        style="border: none; border-top: 1px solid #d1ddeb"
      />
      <div class="filter-container">
        <el-button
          class="filter-item bttnleft"
          type="primary"
          @click="handleFilterref"
          ><i
            class="el-icon-refresh"
            style="padding-right: 5px"
          />刷新</el-button
        >
      </div>
    </el-header>
    <!---header-->

    <!--content-->
    <el-container style="margin-top: 50px !important">
      <el-aside width>
        <el-table
          v-loading="listLoading"
          :data="ActChannelcfgBllData"
          stripe
          fit
          highlight-current-row
          style="width: 100%; margin-top: 0"
          @current-change="handleCurrentChange"
        >
          <el-table-column label="企业" align="left" min-width="120px">
            <template slot-scope="{ row }">
              <span v-if="row.cpnIDStr.length <= 12">{{ row.cpnIDStr }}</span>
              <span v-if="row.cpnIDStr.length > 12" :title="row.cpnIDStr"
                >{{ row.cpnIDStr.substring(0, 12) }}...</span
              >
            </template>
          </el-table-column>
          <!-- <el-table-column label="操作类型" align="left" min-width="50px">
            <template slot-scope="{ row }">
              <span>{{ row.handleTyp == 0 ? "新增" : "修改" }}</span>
            </template>
          </el-table-column>-->
          <el-table-column label="前置机" align="left" min-width="80px">
            <template slot-scope="{ row }">
              <span v-if="row.actName.length <= 4">{{ row.actName }}</span>
              <span v-if="row.actName.length > 4" :title="row.actName"
                >{{ row.actName.substring(0, 4) }}...</span
              >
            </template>
          </el-table-column>
          <el-table-column label="主/次事件" align="left" min-width="80px">
            <template slot-scope="{ row }">
              <span>{{
                row.prtActId == "" || row.prtActId == null ? "主事件" : "次事件"
              }}</span>
            </template>
          </el-table-column>
          <el-table-column label="审核状态" align="left" min-width="80px">
            <template slot-scope="{ row }">
              <span
                :class="{
                  orgaine: row.trialStt == 0,
                  green: row.trialStt == 1,
                  red: row.trialStt == 2,
                }"
                >{{ row.trialSttStr }}</span
              >
            </template>
          </el-table-column>
          <el-table-column label="更新时间" align="left" min-width="130px">
            <template slot-scope="{ row }">
              <span>{{ row.uptDttStr }}</span>
            </template>
          </el-table-column>
          <el-table-column label="经办人" align="left" min-width="80px">
            <template slot-scope="{ row }">
              <span>{{ row.uptr }}</span>
            </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="listQuery.total > 0"
          :total="listQuery.total"
          :page.sync="listQuery.page"
          :limit.sync="listQuery.limit"
          @pagination="fetchData(this)"
        />
      </el-aside>
      <el-main v-loading="formLoading">
        <div
          v-for="(cfgbll, index) in historycfgbll"
          :key="index"
          class="rightdiv"
        >
          <div v-show="index <= 0" class="newinfodiv">
            <div class="bllno_sttdiv">
              <div class="bllnodiv">
                <div class="bllnospan">{{ cfgbll.bllNo }}</div>
                <div class="bllnoname">单据号</div>
              </div>
              <div
                v-if="cfgbll.trialStt == 0"
                class="sttdiv"
                style="background: #f2b769"
              >
                <span class="sttname">待审核</span>
              </div>
              <div
                v-else-if="cfgbll.trialStt == 1"
                class="sttdiv"
                style="background: green"
              >
                <span class="sttname">审核通过</span>
              </div>
              <div
                v-else-if="cfgbll.trialStt == 2"
                class="sttdiv"
                style="background: #999999"
              >
                <span class="sttname">审核拒绝</span>
              </div>
            </div>
            <div class="linediv" />
            <div class="infocontentdiv">
              <div class="infocontent_line">
                <div class="infocontent_item_1">
                  <span class="infocontent_item_name">企业：</span>
                  <span class="infocontent_item_content">{{
                    cfgbll.cpnIDStr
                  }}</span>
                </div>
                <div class="infocontent_item_2">
                  <span class="infocontent_item_name">前置机：</span>
                  <span class="infocontent_item_content">{{
                    cfgbll.actName
                  }}</span>
                </div>
                <div class="infocontent_item_3">
                  <span class="infocontent_item_name">分账类型：</span>
                  <span class="infocontent_item_content">{{
                    cfgbll.rulTyp == 0 ? "金额" : "笔数"
                  }}</span>
                </div>
              </div>
              <div class="infocontent_line">
                <div class="infocontent_item_1">
                  <span class="infocontent_item_name">操作人：</span>
                  <span class="infocontent_item_content">{{
                    cfgbll.operation
                  }}</span>
                </div>
                <div class="infocontent_item_2">
                  <span class="infocontent_item_name">提交时间：</span>
                  <span class="infocontent_item_content">{{
                    cfgbll.dtStr
                  }}</span>
                </div>
                <div class="infocontent_item_3">
                  <span class="infocontent_item_name">主/次事件：</span>
                  <span class="infocontent_item_content">{{
                    cfgbll.prtActId == "" || cfgbll.prtActId == null
                      ? "主事件"
                      : "次事件"
                  }}</span>
                </div>
              </div>
              <div class="infocontent_line">
                <div class="infocontent_item_1">
                  <span class="infocontent_item_name">开始日期：</span>
                  <span class="infocontent_item_content">{{
                    cfgbll.actStdtStr
                  }}</span>
                </div>
                <div class="infocontent_item_2">
                  <span class="infocontent_item_name">结束日期：</span>
                  <span class="infocontent_item_content">{{
                    cfgbll.actEdtStr
                  }}</span>
                </div>
                <div class="infocontent_item_3">
                  <span class="infocontent_item_name">分账规则：</span>
                  <span class="infocontent_item_content">{{
                    cfgbll.limitCyl == 0 ? "满额即停" : "按日迭代"
                  }}</span>
                </div>
              </div>

              <div class="infocontent_line">
                <div class="infocontent_item_1">
                  <span class="infocontent_item_name"
                    >账户分流比列及上限金额</span
                  >
                  <span class="infocontent_item_content">{{
                    cfgbll.payTyp
                  }}</span>
                </div>
              </div>
              <div>
                <el-table
                  :data="cfgbll.cpnActCfgInfoRuleDTOs"
                  style="width: 100%"
                  fit
                  :span-method="objectSpanMethod"
                >
                  <el-table-column
                    label="分流账户"
                    align="left"
                    min-width="300px"
                  >
                    <template slot-scope="{ row }">
                      <span>{{ row.alisNme }}[{{ row.act }}]</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="分流渠道"
                    align="left"
                    min-width="220px"
                  >
                    <template slot-scope="{ row }">
                      <span>{{ row.payTypStr }}-{{ row.payChannelStr }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column label="分流比列" align="left" width="130px">
                    <template slot-scope="{ row }">
                      <template v-if="row.typ == 0">
                        <el-input
                          v-model="row.rule"
                          class="edit-input"
                          size="small"
                          style="width: 70px"
                          :disabled="true"
                        />
                      </template>
                      <template v-else>
                        <el-input
                          v-model="row.rule"
                          class="edit-input"
                          size="small"
                          style="width: 70px"
                          maxlength="2"
                          :disabled="true"
                        />
                      </template>
                      %
                    </template>
                  </el-table-column>
                  <el-table-column label="上限金额" align="left" width="160px">
                    <template slot-scope="{ row }">
                      <template v-if="row.typ == 0">
                        <el-input
                          value="—"
                          class="edit-input"
                          size="small"
                          style="width: 100px"
                          :disabled="true"
                        />
                      </template>
                      <template v-else>
                        <el-input
                          v-model="row.limitMny"
                          class="edit-input"
                          size="small"
                          style="width: 100px"
                          maxlength="6"
                          :disabled="true"
                        />
                      </template>
                      元
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </div>
            <div v-show="cfgbll.trialStt == 2" class="infocontent_line">
              <div class="infocontent_item_auto">
                <span class="infocontent_item_name" style="color: red"
                  >修改/拒绝理由：</span
                >
                <span class="infocontent_item_content" style="color: red">{{
                  cfgbll.brf
                }}</span>
              </div>
            </div>
            <div slot="footer" class="dialog-footer">
              <el-button
                v-if="cfgbll.trialStt == 0 && Jurisdiction('审核')"
                type="success"
                icon="el-icon-circle-check"
                @click="saveForm(1)"
                >审核通过</el-button
              >
              <el-button
                v-if="cfgbll.trialStt == 0 && Jurisdiction('审核')"
                type="danger"
                style="margin-right: 20px"
                icon="el-icon-circle-close"
                @click="ApprovedClick()"
                >审核拒绝</el-button
              >
            </div>
            <div class="Dividingline" />
          </div>
          <div v-show="index > 0" class="oldinfodiv">
            <div class="historydiv">
              <img
                src="@/assets/oldrecord.png"
                width="14px"
                height="14px"
                title="历史提交记录"
              />&nbsp;历史提交记录
            </div>
            <div class="oldinfocontent">
              <div class="bllno_sttdiv">
                <div class="bllnodiv">
                  <div class="bllnospan">{{ cfgbll.bllNo }}</div>
                  <div class="bllnoname">单据号</div>
                </div>
                <div class="sttdiv" style="background: #999999">
                  <span class="sttname">{{ cfgbll.trialSttStr }}</span>
                </div>
              </div>
              <div class="linediv" />
              <div class="infocontentdiv">
                <div class="infocontent_line">
                  <div class="infocontent_item_1">
                    <span class="infocontent_item_name">企业：</span>
                    <span class="infocontent_item_content">{{
                      cfgbll.cpnIDStr
                    }}</span>
                  </div>
                  <div class="infocontent_item_2">
                    <span class="infocontent_item_name">前置机：</span>
                    <span class="infocontent_item_content">{{
                      cfgbll.actName
                    }}</span>
                  </div>
                  <div class="infocontent_item_3">
                    <span class="infocontent_item_name">分账类型：</span>
                    <span class="infocontent_item_content">{{
                      cfgbll.rulTyp == 0 ? "金额" : "笔数"
                    }}</span>
                  </div>
                </div>
                <div class="infocontent_line">
                  <div class="infocontent_item_1">
                    <span class="infocontent_item_name">操作人：</span>
                    <span class="infocontent_item_content">{{
                      cfgbll.operation
                    }}</span>
                  </div>
                  <div class="infocontent_item_2">
                    <span class="infocontent_item_name">提交时间：</span>
                    <span class="infocontent_item_content">{{
                      cfgbll.dtStr
                    }}</span>
                  </div>
                  <div class="infocontent_item_3">
                    <span class="infocontent_item_name">主/次事件：</span>
                    <span class="infocontent_item_content">{{
                      cfgbll.prtActId == "" || cfgbll.prtActId == null
                        ? "主事件"
                        : "次事件"
                    }}</span>
                  </div>
                </div>
                <div class="infocontent_line">
                  <div class="infocontent_item_1">
                    <span class="infocontent_item_name">开始日期：</span>
                    <span class="infocontent_item_content">{{
                      cfgbll.actStdtStr
                    }}</span>
                  </div>
                  <div class="infocontent_item_2">
                    <span class="infocontent_item_name">结束日期：</span>
                    <span class="infocontent_item_content">{{
                      cfgbll.actEdtStr
                    }}</span>
                  </div>
                  <div class="infocontent_item_3">
                    <span class="infocontent_item_name">分账规则：</span>
                    <span class="infocontent_item_content">{{
                      cfgbll.limitCyl == 0 ? "满额即停" : "按日迭代"
                    }}</span>
                  </div>
                </div>

                <div class="infocontent_line">
                  <div class="infocontent_item_1">
                    <span class="infocontent_item_name"
                      >账户分流比列及上限金额</span
                    >
                    <span class="infocontent_item_content">{{
                      cfgbll.payTyp
                    }}</span>
                  </div>
                </div>
                <div>
                  <el-table
                    :data="cfgbll.cpnActCfgInfoRuleDTOs"
                    style="width: 100%"
                    fit
                    :span-method="objectSpanMethod"
                  >
                    <el-table-column
                      label="分流账户"
                      align="left"
                      min-width="300px"
                    >
                      <template slot-scope="{ row }">
                        <span>{{ row.alisNme }}[{{ row.act }}]</span>
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="分流渠道"
                      align="left"
                      min-width="220px"
                    >
                      <template slot-scope="{ row }">
                        <span>{{ row.payTypStr }}-{{ row.payChannelStr }}</span>
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="分流比列"
                      align="left"
                      width="130px"
                    >
                      <template slot-scope="{ row }">
                        <template v-if="row.typ == 0">
                          <el-input
                            v-model="row.rule"
                            class="edit-input"
                            size="small"
                            style="width: 70px"
                            :disabled="true"
                          />
                        </template>
                        <template v-else>
                          <el-input
                            v-model="row.rule"
                            class="edit-input"
                            size="small"
                            style="width: 70px"
                            maxlength="2"
                            :disabled="true"
                          />
                        </template>
                        %
                      </template>
                    </el-table-column>
                    <el-table-column
                      label="上限金额"
                      align="left"
                      width="160px"
                    >
                      <template slot-scope="{ row }">
                        <template v-if="row.typ == 0">
                          <el-input
                            value="—"
                            class="edit-input"
                            size="small"
                            style="width: 100px"
                            :disabled="true"
                          />
                        </template>
                        <template v-else>
                          <el-input
                            v-model="row.limitMny"
                            class="edit-input"
                            size="small"
                            style="width: 100px"
                            maxlength="6"
                            :disabled="true"
                          />
                        </template>
                        元
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
                <div v-show="cfgbll.trialStt == 2" class="infocontent_line">
                  <div class="infocontent_item_auto">
                    <span class="infocontent_item_name" style="color: red"
                      >修改/拒绝理由：</span
                    >
                    <span class="infocontent_item_content" style="color: red">{{
                      cfgbll.brf
                    }}</span>
                  </div>
                </div>
              </div>

              <div class="Dividingline" />
            </div>
          </div>
        </div>
      </el-main>
    </el-container>
    <el-dialog
      :visible.sync="cpnActCfgBllApproved_dialogVisible"
      width="50%"
      :before-close="handleClose"
      :show-close="false"
      class="cpnActCfgBllApproved_dialogVisible"
    >
      <el-form
        ref="form"
        :model="form"
        label-width="120px"
        label-position="top"
      >
        <div class="first_title">审核拒绝</div>
        <el-form-item label="拒绝理由">
          <el-input v-model="AprvdComt" type="textarea" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cpnActCfgBllApproved_dialogVisible = false"
          >取 消</el-button
        >
        <el-button type="primary" @click="saveForm(2)">确定</el-button>
      </span>
    </el-dialog>
    <!--content-->
  </el-container>
</template>

<script>
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import { AjaxToken, TipConfirm } from "@/api/common";
import { SelectAjax } from "@/api/common";
import { Jurisdiction } from "@/api/common";
import { Loading } from "element-ui";
import sessionStorage from "@/api/Storage";
import "url-search-params-polyfill"; // 兼容IE，否则无法识别URLSearchParams
import PinYinMatch from "pinyin-match";
export default {
  name: "ActChannelcfgBll",
  components: { Pagination },
  data() {
    return {
      cpnoptions: [],
      active: 0,
      divid: 0,
      logincpnid: "",
      cfgpass: false,
      actpass: false,
      historycfgbll: [],
      cpnActCfgBll_dialogVisible: false,
      cpnActCfgBllApproved_dialogVisible: false,
      multipleSelection: [],
      formLabelWidth: "120px",
      ActChannelcfgBllData: null,
      trialSttoptions: [],
      payconfig: [],
      payoldconfig: [],
      auditTests: [],
      listQuery: {
        bllNo: "",
        total: 0,
        page: 1,
        limit: 10,
        trialStt: "",
        Dt:"",
      },
      listLoading: true,
      formLoading: false,
      auditLoading: true,
      dialogFormVisible: false,
      dialogdetailsVisible: false,
      dialogStatus: "",
      textMap: {
        update: "修改",
        create: "添加",
      },
      form: {
        bllNo: "",
        cpnID: "",
        orgID: "",
        handleTyp: "",
        actCfgID: "",
        payTyp: "",
        payChannel: "",
        alisNme: "",
        acctCfg: "",
        act: "",
        isEmrgncy: "",
        isRc: "",
        pyTyps: "",
        brf: "",
        stt: 1,
        createUsr: "",
        createTime: "",
        uptr: "",
        uptDtt: "",
        authcode: "",
        AprvdComt: "",
        AprvdTyp: 0,
      },
      actchannelcfg: {},
      actchannelcfgrules: [],
      AprvdComt: "",
      oldform: {
        id: "",
        cpnID: "",
        orgID: "",
        handleTyp: "",
        actCfgID: "",
        payTyp: "",
        payChannel: "",
        alisNme: "",
        acctCfg: "",
        act: "",
        isEmrgncy: "",
        isRc: "",
        pyTyps: "",
      },
    };
  },

  // 初始化
  created() {
    var userinfo = JSON.parse(sessionStorage.getItem("userinfo"));
    this.logincpnid = userinfo.cpnId;
    this.fetchData();
    backstage.GetEnum_TrialStt(this, false);
    backstage.GeCpntListItems(this);
  },
  methods: {
    cpnmatch(val) {
      if (val) {
        let result = [];
        this.cpnoptions.forEach((item) => {
          let matchRes = PinYinMatch.match(item.label, val);
          if (matchRes) {
            result.push(item);
          }
        });
        this.cpnoptions = result;
      } else {
        this.cpnid = "";
        this.cpnoptions = backstage.GeCpntListItems(this);
      }
    },
    // 搜索
    handleFilter() {
      this.listQuery.page = 1;
      this.fetchData();
    },
    // 搜索
    handleFilterref() {
      this.listQuery = {
        bllNo: "",
        total: 0,
        page: 1,
        limit: 10,
        trialStt: "",
      };
      this.fetchData();
    },
    // 跨行处理
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0 || columnIndex >= 1) {
        // 支付通道跨行
        if (columnIndex == 0) {
          if (row.actspan > 0) {
            return {
              rowspan: row.actspan,
              colspan: 1,
            };
          } else {
            return {
              rowspan: 0,
              colspan: 0,
            };
          }
        }
        // 支付通道跨行 结束

        // 比列 上限金额跨行
        if (columnIndex > 1) {
          if (row.typ == 0) {
            if (row.typspan > 0) {
              return {
                rowspan: row.typspan,
                colspan: 1,
              };
            } else {
              return {
                rowspan: 0,
                colspan: 0,
              };
            }
          } else {
            if (row.actspan > 0) {
              return {
                rowspan: row.actspan,
                colspan: 1,
              };
            } else {
              return {
                rowspan: 0,
                colspan: 0,
              };
            }
          }
        }
        // 比列 上限金额跨行 结束
      }
    },
    // 弹层关闭
    handleClose() {},
    // 权限
    Jurisdiction(moduleActionName) {
      return Jurisdiction(moduleActionName, this);
    },
    // 单选
    handleCurrentChange(val) {
      this.historycfgbll = [];
      this.currentRow = val;
      this.form = val;
      var params2 = new URLSearchParams();
      params2.append("BllNo", val.bllNo);
      this.formLoading = true;
      backstage.GetCpnActCfgBllLstByBllNo(this, params2);
    },
    // 搜索
    handleFilter() {
      this.listQuery.page = 1;
      this.fetchData();
    },
    // 审核拒绝
    ApprovedClick() {
      this.form.cpnID = "";
      this.AprvdComt = "";
      this.cpnActCfgBllApproved_dialogVisible = true;
    },
    // 审核通过
    saveForm(stt) {
      this.form.cpnID = "";
      var arr = this.multipleSelection;
      var params = new URLSearchParams();
      params.append("BllNo", this.actchannelcfg.bllNo);
      params.append("CpnID", this.actchannelcfg.cpnID);
      params.append("Stt", stt);

      // params.append("AprvdTyp", this.form.AprvdTyp);//拒绝类型
      params.append("AprvdComt", this.AprvdComt);
      const loading = this.$loading({
        lock: true,
        text: "Loading",
        spinner: "filter-container",
        background: "rgba(0, 0, 0, 0.7)",
      });
      backstage.AuditPass(this, params, loading);
    },
    // 查询
    fetchData() {
      this.listLoading = true;
      var params = new URLSearchParams();
      params.append(
        "Parms",
        '{"page":' +
          this.listQuery.page +
          ',"rows":' +
          this.listQuery.limit +
          "}"
      );
      params.append("BllNo", this.listQuery.bllNo);
      params.append(
        "CpnID",
        this.logincpnid == "system" ? this.form.cpnID : this.logincpnid
      );
      params.append("TrialStt", this.listQuery.trialStt);
      params.append("ActTyp", 1);
      params.append(
        "Dt",
        this.listQuery.Dt == "" || this.listQuery.Dt == null
          ? null
          : new Date(this.listQuery.Dt).toLocaleDateString()
      );
      this.historycfgbll = [];
      backstage.GetCpnActCfgBllLst(this, params);
    },
  },
};
// 后台事件
var backstage = {
  // 获取CpnActCfgBll集合
  GetCpnActCfgBllLst: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "GetActChannelCfgBllLst",
      params,
      "post",
      function (res) {
        thisobj.listLoading = false;
        var body = res.data.data;
        thisobj.ActChannelcfgBllData = [];
        thisobj.ActChannelcfgBllData = body.rows;
        thisobj.listQuery.page = body.page;
        thisobj.listQuery.total = body.records;
        var params2 = new URLSearchParams();
        params2.append("BllNo", body.rows[0].bllNo);
        thisobj.formLoading = true;
        backstage.GetCpnActCfgBllLstByBllNo(thisobj, params2);
      },
      function (err) {
        thisobj.listLoading = false;
      }
    );
  },
  // 获取历史CpnActCfgBll集合
  GetCpnActCfgBllLstByBllNo: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "GetActChannelCfgBllLstByBllNo",
      params,
      "post",
      function (res) {
        thisobj.listLoading = false;
        thisobj.formLoading = false;
        var body = res.data.data;
        thisobj.historycfgbll = body.rows;
        if (body.rows.length > 0) {
          // 加载右边信息
          thisobj.actchannelcfg = body.rows[0];
        }
      },
      function (err) {
        thisobj.listLoading = false;
        thisobj.formLoading = true;
      }
    );
  },
  GetEnum_TrialStt: function (thisobj, isEmpty) {
    SelectAjax(
      "GetEnum_TrialStt?isEmpty=" + isEmpty + "+&code=0",
      function (response) {
        var body = response.data;

        thisobj.trialSttoptions = [];
        body.data.forEach((element) => {
          thisobj.trialSttoptions.push({
            value: element.value,
            label: element.text,
          });
        });
      },
      function (error) {}
    );
  },
  GetOldCpnActCfgInfo: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "GetOldCpnActCfgInfo",
      params,
      "post",
      function (res) {
        var body = res.data.data;
        if (body != null) {
          thisobj.oldform = body;

          thisobj.payoldconfig = JSON.parse(thisobj.oldform.acctCfg);
        }
      },
      function (err) {}
    );
  },
  AuditCpnActCfgBll: function (thisobj, params, loading) {
    AjaxToken(
      thisobj,
      "AuditCpnActCfgBll",
      params,
      "post",
      function (res) {
        if (loading != undefined) {
          loading.close();
        }
        var body = res.data;
        if (body.success) {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "success",
            duration: 2000,
          });
          thisobj.fetchData();
          thisobj.dialogFormVisible = false;
        } else {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "error",
          });
        }
      },
      function (err) {}
    );
  },
  AuditTest: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "AuditTest",
      params,
      "post",
      function (res) {
        var body = res.data;
        thisobj.auditTests = body.data;
        thisobj.auditLoading = false;
        thisobj.cfgpass = true;
        thisobj.auditTests.forEach((element) => {
          var obj = element;
          if (!element.success) {
            thisobj.cfgpass = false;
          }
        });
      },
      function (err) {
        thisobj.auditLoading = false;
      }
    );
  },
  PayTest: function (thisobj, params) {
    AjaxToken(
      thisobj,
      "AuditTest",
      params,
      "post",
      function (res) {
        thisobj.auditLoading = false;
        var body = res.data;
        var newd = [];
        var rsobj = res.data.data[0];
        thisobj.auditTests.forEach((element) => {
          var obj = element;
          if (rsobj.payTyp == element.payTyp) {
            obj.isCheck = rsobj.isCheck;
            obj.type = 1;
            obj.success = true;
            obj.authcode = rsobj.authcode;
            obj.errmsg = rsobj.errmsg;
          }
          newd.push(obj);
        });
        // thisobj.auditTests=newd;
      },
      function (err) {
        thisobj.auditLoading = false;
        thisobj.cfgpass = true;
      }
    );
  },
  GeCpntListItems: function (thisobj) {
    SelectAjax(
      "GeCpntListItems",
      function (response) {
        var body = response.data;
        thisobj.cpnoptions = [];
        body.data.forEach((element) => {
          thisobj.cpnoptions.push({
            value: element.value,
            label: element.text,
          });
        });
      },
      function (error) {}
    );
  },
  AuditPass: function (thisobj, params, loading) {
    AjaxToken(
      thisobj,
      "AuditPassActChannel",
      params,
      "post",
      function (res) {
        loading.close();
        var body = res.data;
        if (body.success) {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "success",
            duration: 3000,
          });
          thisobj.fetchData();
          thisobj.cpnActCfgBll_dialogVisible = false;
          thisobj.cpnActCfgBllApproved_dialogVisible = false;
        } else {
          thisobj.$message({
            showClose: true,
            message: body.message,
            type: "error",
          });
        }
      },
      function (err) {
        thisobj.fetchData();
        thisobj.cpnActCfgBll_dialogVisible = false;
        thisobj.cpnActCfgBllApproved_dialogVisible = false;
      }
    );
  },
};
</script>

<style lang="scss" scoped>
.main {
  padding-top: 10px;
}
.el-header {
  line-height: 30px;
}
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
  text-align: center;
}

.el-aside {
  background-color: #f0f2f5;
  color: #333;
  text-align: center;
  height: auto;
  margin-bottom: 0px;
  padding: 10px 10px;
  width: 45%;
}

.el-main {
  background-color: #f0f2f5;
  color: #333;
  text-align: center;
  padding: 10px 10px;
  height: auto;
}

body > .el-container {
  margin-bottom: 0px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.actiontable {
  width: 100%;
  height: 100%;
  max-height: 660px;
  overflow: auto;
}
.moduletabe {
  width: 100%;
  height: 100%;
  max-height: 745px;
  overflow: auto;
}
.pagination {
  background-color: white;
  height: 85px;
  padding-top: 25px !important;
  margin-top: inherit;
}
.rightdiv {
  background-color: white;
  padding-top: 35px;
  padding-left: 35px;
}
.midText {
  position: absolute;
  left: 50%;
  background-color: #ffffff;
  padding: 0 15px;
  transform: translateX(-50%) translateY(-50%);
}
.text {
  font-size: 14px;
}

.item {
  /* margin-bottom: 18px; */
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}

.box-card {
  width: 100%;
  margin-bottom: 6px;
}
.newinfodiv {
}
.Dividingline {
  margin-left: -35px;
  margin-top: 10px;
  border-bottom: 1px solid #e6e6e6;
}
.oldinfocontent {
  margin-top: 10px;
  padding-bottom: 25px;
}
.bllno_sttdiv {
  display: flex;
  justify-content: space-between;
}
.bllnodiv {
}
.bllnodiv .bllnospan {
  font-size: 18px;
  font-weight: 400;
  line-height: 31px;
  color: #409eff;
  text-align: left;
}
.bllnodiv .bllnoname {
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  color: #c3cad2;
  text-align: left;
  width: 80%;
}
.sttdiv {
  border-radius: 44px 0px 0px 0px;
  width: 20%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.sttdiv .sttname {
  font-size: 18px;
  font-weight: 400;
  line-height: 31px;
  color: #ffffff;
}
.linediv {
  width: 100%;
  height: 0;
  border-bottom: 1px dashed #e6e6e6;
  margin-top: 20px;
}
.infocontent_line {
  margin-top: 20px;
  display: flex;
  justify-content: flex-start;
  text-align: left;
}
.infocontent_item_1 {
  font-size: 14px;
  width: 30%;
}
.infocontent_item_2 {
  font-size: 14px;
  width: 40%;
}
.infocontent_item_3 {
  font-size: 14px;
  width: 30%;
}
.infocontent_item_auto {
  font-size: 14px;
}
.infocontent_item_name {
  color: #959ea8;
}
.infocontent_item_content {
  color: #304156;
}
.newinfodiv .dialog-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-bottom: 10px;
}
.oldinfodiv .historydiv {
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  color: #999999;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 10px;
  margin-left: -20px;
}
.refusediv {
  padding-left: 10px;
  background: #f5f5f5;
  border-radius: 4px;
  padding-top: 5px;
  margin-top: 10px;
  padding-bottom: 10px;
}
.cfg_test {
  width: 60%;
  margin: 0px auto;
  height: 100px;
  height: 100%;
}
.cfg_test_pyt_title {
  height: 14px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: bold;
  line-height: 24px;
  color: #304156;
  opacity: 1;
  float: left;
}
.cfg_test_res_title {
  height: 14px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: bold;
  line-height: 24px;
  color: #304156;
  opacity: 1;
  float: right;
  width: 300px;
}
.cfg_test_pyt {
  float: left;
  height: 14px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  line-height: 24px;
  color: #304156;
  opacity: 1;
}
.cfg_test_res {
  float: right;
  width: 300px;
  height: 14px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  line-height: 24px;
  color: #1ab448;
  opacity: 1;
}
.cfg_test_res_error {
  float: right;
  width: 300px;
  height: 14px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  line-height: 24px;
  color: #e8534e;
  opacity: 1;
}
.cfg_divinlinecls {
  display: flex;
  justify-content: space-between;
  opacity: 1;
  line-height: 20px;
  margin-top: 15px;
}
.cfg_test_res_errormsg {
  height: 12px;
  font-size: 12px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  line-height: 20px;
  color: #666666;
  opacity: 1;
}
.cfg_errimg {
  top: 1px;
  position: relative;
  cursor: pointer;
}
.cfg_act {
  margin: 0px auto;
}
.cfg_act_test {
  display: flex;
  margin: 10px 0px 15px 10px;
  overflow: hidden;
}
.cfg_act_test .cfg_act_test_word {
  width: 300px;
  font-size: 14px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  line-height: 34px;
  color: #304156;
  opacity: 1;
  display: flex;
}
.cfg_act_test_word1 {
  width: 90px;
  display: flex;
}
.cfg_act_test_word2 {
  width: 30px;
  display: block;
}
.cfg_act_test_word3 {
  width: 70px;
  display: block;
}

.pay_input {
  display: -webkit-box;
  display: -ms-flexbox;
  /* display: flex; */
  width: 220px;
  float: left;
}
.pay_button {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  /* width: 300px; */
  float: left;
}
</style>

<style>
.cpnActCfgBll_dialog .el-dialog__header {
  padding: 0px;
  padding-bottom: 0px;
}
.cpnActCfgBllApproved_dialogVisible .el-dialog__header {
  padding: 0px;
  padding-bottom: 0px;
}
.cpnActCfgBllApproved_dialogVisible .first_title {
  margin: 0px 0px 30px 0px;
}
.cfg_act .el-input--medium {
  margin-right: 15px;
}
.cfg_act_test .el-checkbox-button__inner {
  opacity: 1;
  border-radius: 18px !important;
  margin: 0px 10px 0px 10px;
}
.cfg_act_test .el-checkbox-button.is-checked .el-checkbox-button__inner {
  color: #fff;
  background-color: #1ab448;
  border-color: #1ab448;
  -webkit-box-shadow: -1px 0 0 0 #1ab448;
  box-shadow: -1px 0 0 0#1AB448;
}
.cfg_act_test .el-checkbox-button:first-child .el-checkbox-button__inner {
  border-left: 1px solid#1ab448;
  border-radius: 4px 0 0 4px;
  -webkit-box-shadow: none !important;
  box-shadow: none !important;
}
.cfg_act_test .el-checkbox-button.is-focus .el-checkbox-button__inner {
  border-color: #1ab448;
}
.cfg_act_test .el-checkbox-button__inner {
  border-color: #1ab448;
  color: #1ab448;
}

.cpnActCfgBllApproved_dialogVisible .el-textarea__inner {
  height: 200px;
}
</style>
